package cn.com.qingz.core.utils;
import java.util.Date;
import org.apache.shiro.SecurityUtils;
import cn.com.qingz.core.model.UpdateUserInfo;
public class UpdateUserHelper {
	
	public static void addCreater(UpdateUserInfo currentEntity){
		String currentUser = SecurityUtils.getSubject().getPrincipal().toString();
		currentEntity.setCreatetime(new Date());
		currentEntity.setCreateuser(currentUser);
	}
	
	public static void addModitier(UpdateUserInfo currentEntity){
		String currentUser = SecurityUtils.getSubject().getPrincipal().toString();
		currentEntity.setLmodifytime(new Date()); 
		currentEntity.setLmodifyuser(currentUser);
	}
	
	public static String getCurrentLoginUser(){
		String currentUser = SecurityUtils.getSubject().getPrincipal().toString();
		return currentUser;
	}
}
